<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
 */
Route::get('/', ["as" => "admin.admin.center", 'middleware' => ['check.admin.status'], "uses" => "Admin\AdminController@getCenter"]);
Route::get('/admin/auth/login', ["as" => "admin.auth.login", "uses" => "Admin\AuthController@getLogin"]);
Route::post('/admin/auth/login', ["as" => "admin.auth.login", "uses" => "Admin\AuthController@postLogin"]);
Route::get('/admin/auth/logout', ["as" => "admin.auth.logout", "uses" => "Admin\AuthController@getLogout"]);

//单点登录
Route::group(['prefix' => 'staff', 'namespace' => 'Staff', 'middleware' => []], function ($app) {
    Route::get('/staff', ["as" => "staff.staff.center", "uses" => "StaffController@getCenter"]);
    //
    Route::get('/auth/login', ["as" => "staff.auth.login", "uses" => "AuthController@getLogin"]);
    Route::post('/auth/login', ["as" => "staff.auth.login", "uses" => "AuthController@postLogin"]);
    Route::get('/auth/ticket', ["as" => "staff.auth.ticket", "uses" => "AuthController@getTicket"]);
    Route::get('/auth/logout', ["as" => "staff.auth.logout", "uses" => "AuthController@getLogout"]);
    //
    Route::post('/staff/auth', ["as" => "staff.staff.auth", "uses" => "StaffController@postAuth"]);
    Route::post('/staff/auth_check', ["as" => "staff.staff.auth.check", "uses" => "StaffController@postAuthCheck"]);
});
//管理员模块
Route::group(['prefix' => 'admin', 'namespace' => 'Admin', 'middleware' => ['check.admin.status']], function ($app) {
    $app->get('/app/app', ['as' => 'admin.app.app', 'uses' => 'AppController@getApp']);
    $app->get('/app/app_add', ['as' => 'admin.app.app.add', 'uses' => 'AppController@getAppAdd']);
    $app->get('/app/app_edit', ['as' => 'admin.app.app.edit', 'uses' => 'AppController@getAppEdit']);
    //
    $app->get('/app/auth', ['as' => 'admin.app.auth', 'uses' => 'AppController@getAuth']);
    $app->get('/app/auth_add', ['as' => 'admin.app.auth.add', 'uses' => 'AppController@getAuthAdd']);
    $app->get('/app/auth_edit', ['as' => 'admin.app.auth.edit', 'uses' => 'AppController@getAuthEdit']);
    //
    $app->get('/app/group', ['as' => 'admin.app.group', 'uses' => 'AppController@getGroup']);
    $app->get('/app/group_auth', ['as' => 'admin.app.group.auth', 'uses' => 'AppController@getGroupAuth']);
    $app->get('/app/group_add', ['as' => 'admin.app.group.add', 'uses' => 'AppController@getGroupAdd']);
    $app->get('/app/group_edit', ['as' => 'admin.app.group.edit', 'uses' => 'AppController@getGroupEdit']);
    //
    $app->get('/app/staff', ['as' => 'admin.app.staff', 'uses' => 'StaffController@getStaff']);
    $app->get('/app/staff_add', ['as' => 'admin.app.staff.add', 'uses' => 'StaffController@getStaffAdd']);
    $app->get('/app/staff_edit', ['as' => 'admin.app.staff.edit', 'uses' => 'StaffController@getStaffEdit']);
    $app->get('/app/staff_apps', ['as' => 'admin.app.staff.apps', 'uses' => 'StaffController@getStaffApps']);
    $app->get('/app/staff_apps_relation_edit', ['as' => 'admin.app.staff.apps.relation.edit', 'uses' => 'StaffController@getStaffAppsRelationEdit']);
    //
    $app->get('/app/dept', ['as' => 'admin.app.staff.dept', 'uses' => 'StaffController@getDept']);
    $app->get('/app/dept_add', ['as' => 'admin.app.staff.dept.add', 'uses' => 'StaffController@getdeptAdd']);
    $app->get('/app/dept_edit', ['as' => 'admin.app.staff.dept.edit', 'uses' => 'StaffController@getdeptEdit']);
    //
    $app->get('/app/post', ['as' => 'admin.app.staff.post', 'uses' => 'StaffController@getPost']);
    $app->get('/app/post_add', ['as' => 'admin.app.staff.post.add', 'uses' => 'StaffController@getPostAdd']);
    $app->get('/app/post_edit', ['as' => 'admin.app.staff.post.edit', 'uses' => 'StaffController@getPostEdit']);
    //
    $app->get('/admin/admin', ['as' => 'admin.admin.admin', 'uses' => 'AdminController@getAdmin']);
    $app->get('/admin/admin_add', ['as' => 'admin.admin.admin.add', 'uses' => 'AdminController@getAdminAdd']);
    $app->get('/admin/admin_edit', ['as' => 'admin.admin.admin.edit', 'uses' => 'AdminController@getAdminEdit']);
});
